package cn.java59;

import java.util.Scanner;

public class Homework5 {

	public static void main(String[] args) {
		System.out.print("请输入数字:");
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int max = num;
		int min = num;
		while (true) {
			if (num == 0) {
				System.out.println("输入结束!");
				break;
			}
			if (num > max) {
				max = num;
			}
			if (num < min) {
				min = num;
			}
			System.out.print("请输入数字:");
			scan = new Scanner(System.in);
			num = scan.nextInt();
		}
		System.out.println("本次输入最大值:" + max + "最小值:" + min);
	}

}
